 <?php
 header("Access-Control-Allow-Origin:*");
// header("Access-Control-Allow-Origin:http://localhost:82/register.html");
$username = $_GET["username"];
$password = $_GET["password"];
if(!$username || !$password){
      die("抱歉参不足");
}
require("./link.php");
$password = md5($password);
$select_sql = "SELECT * FROM `jdregist` WHERE `username`='$username' AND `password`='$password'";
$select_res = mysqli_query($con , $select_sql);
if(!$select_res){
      die("数据库查询出错,错误信息" . mysqli_error($con));
}
$arr = mysqli_fetch_all( $select_res, MYSQLI_ASSOC );
if( count($arr) >= 1 ){
      echo '{"type":"success", "msg" : "恭喜登录成功"}';
      // header('Location: ./jp.html');   
}else{
      echo '{"type":"false", "msg" : "密码错误"}';
}
mysqli_close($con);
